import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/views/Index'
import SearchTopic from "@/views/SearchTopic"
import UserCenter from "@/views/UserCenter"
import UserCenterMyInfo from '@/components/userCenter/UserCenter-myInfo'
import UserCenterMyCollect from '@/components/userCenter/UserCenter-myCollect'
import UserCenterMyComment from '@/components/userCenter/UserCenter-myComment'
import UserCenterMyNotice from '@/components/userCenter/UserCenter-myNotice'
import AdminUserCenterManageAnnouncement from '@/components/userCenter/adminUserCenter/AdminUserCenter-manageAnnouncement'
import AdminUserCenterManageDic from '@/components/userCenter/adminUserCenter/AdminUserCenter-manageDic'
import AdminUserCenterManageUser from '@/components/userCenter/adminUserCenter/AdminUserCenter-manageUser'
import AuditorUserCenterAuditTopic from '@/components/userCenter/auditorUserCenter/AuditorUserCenter-auditTopic'
import AuditorUserCenterAuditComment from '@/components/userCenter/auditorUserCenter/AuditorUserCenter-auditComment'
import UploadTopic from "@/views/UploadTopic"
import ShowTopic from "@/views/ShowTopic"
import NotFound from "@/views/NotFound";


Vue.use(VueRouter)

const routes = [
  { //主页面
    path: '/',
    name: 'Index',
    /*component: Index*/
  },
  { //主页面
    path: '/index',
    name: 'Index',
    component: Index
  },
  { //搜索题目
    path:'/searchTopic',
    name:'SearchTopic',
    component: SearchTopic
  },
  { //个人中心
    path: '/userCenter',
    name: 'UserCenter',
    component: UserCenter,
    children: [ //子路由
      { //我的资料
        path:'/userCenter/myInfo',
        name:'UserCenterMyInfo',
        component: UserCenterMyInfo
      },
      { //我的收藏
        path:'/userCenter/myCollect',
        name:'UserCenterMyCollect',
        component: UserCenterMyCollect
      },
      { //我的评论
        path:'/userCenter/myComment',
        name:'UserCenterMyComment',
        component: UserCenterMyComment
      },
      { //消息通知
        path:'/userCenter/myNotice',
        name:'UserCenterMyNotice',
        component: UserCenterMyNotice
      },
      { //管理员-管理公告
        path:'/adminUserCenter/manageAnnouncement',
        name:'AdminUserCenterManageAnnouncement',
        component: AdminUserCenterManageAnnouncement
      },
      { //管理员-管理数据字典
        path:'/adminUserCenter/manageDic',
        name:'AdminUserCenterManageDic',
        component: AdminUserCenterManageDic
      },
      { //管理员-管理用户
        path:'/adminUserCenter/manageUser',
        name:'AdminUserCenterManageUser',
        component: AdminUserCenterManageUser
      },
      { //审核员-审核上传的题目
        path:'/auditorUserCenter/auditTopic',
        name:'AuditorUserCenterAuditTopic',
        component: AuditorUserCenterAuditTopic
      },
      { //审核员-审核评论
        path:'/auditorUserCenter/auditComment',
        name:'AuditorUserCenterAuditComment',
        component: AuditorUserCenterAuditComment
      }
    ]
  },
  { //上传题目
    path:'/uploadTopic',
    name:'UploadTopic',
    component: UploadTopic
  },
  {
    path:'/showTopic',
    name:'ShowTopic',
    component: ShowTopic
  },
  {
    path: '*',
    component: NotFound,
  }




]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
